<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../css/swiper-4.3.5.min.css">
    <link rel="stylesheet" href="../css/element.css">
    <link rel="stylesheet" href="../css/main.css">
    <link rel="stylesheet" href="../css/discount/seckilling.css">
    <title>优惠活动-周期购</title>
</head>

<body>
    <div id="app" v-cloak>
    <headers></headers>
        <!-- search -->
        <div class="search wrap">
            <logo></logo>
            <searchs></searchs>

            <car_box></car_box>
        </div>

        <!-- 商品分类 -->
        <div class="class_box wrap">
            <div class="sub_nav_box">
                <ul class="sub_nav fl">
                    <li @click='seckilling'>限时秒杀</li>
                    <li @click='group_buy'>团购优惠</li>
                    <li class="active">周期购</li>
                </ul>
            </div>
        </div>

        <!-- 秒杀列表 -->
        <div class="seckill_box wrap">
            <div class="cyc_item fl" v-for='(item,index) in cyc_list'>
                <div class="seckill_img cursor" @click='cyc_detail(item.goodsId,item.id)'>
                    <img :src="item.coverImg" alt="">
                </div>
                <div class="seckill_text">
                    <p class="seckill_tit">
                        {{item.spuName}}
                    </p>
                    <div class="seckill_money" v-if="item.periodicBuyDetailSkuList!=''">
                        <span class="money_icon">￥</span>
                        {{item.periodicBuyDetailSkuList[0].goodsPrice}} 
                        <span class="old_money">￥{{item.periodicBuyDetailSkuList[0].salesPrice}}</span>
                        <span class="buy_btn fr" @click='cyc_detail(item.goodsId,item.id)'>立即抢购</span>
                    </div>
                    <!-- <div class="last_text">
                        <div class="fl">单买价 ￥1790</div>
                        <div class="fr">236人已拼</div>
                    </div> -->
                </div>
            </div>
        </div>
        <div class="integral_page wrap">
            <el-pagination background @current-change="handleCurrentChanges" :page-size="20" :current-page="currentPage"
                layout="prev, pager, next" :total="total" class="page_list">
            </el-pagination>
        </div>

       <div class="wrap clear_both">             <productfooter></productfooter>         </div>
    </div>
    <script src="../js/axios.js"></script>         
    <script src="../js/qs.js"></script>
    <script src="../js/swiper-4.3.5.min.js"></script>
    <script src="../js/browser.min.js"></script>
    <script src="../js/vue.js"></script>
    <script src="../js/element.js"></script>
    <script src="../js/main.js"></script>
    <script type="text/babel">
       var app = new Vue({
            el: '#app',
            data() {
                return {
                    seckill_swiper_btn:true,
                    cyc_list:'',
                    car_active:false,
                    groups:3,
                };
            },
            created() {
                
            },
            mounted() {
                this.listUserUser(1)
            },
            methods: {
                handleCurrentChanges(value){
                    this.listUserUser(value)
                },
                // 周期购列表
                listUserUser(page) {
                    axios({
                        method:"POST",
                        url:base_url + "/period/listUserUser",
                        data:Qs.stringify({
                            pageSize:20,
                            pageNum:page
                        }),
                        headers:{
                            'Content-Type':'application/x-www-form-urlencoded',
                            "TOKEN":localStorage.getItem('wACCESS_TOKEN')
                        }
                    })
                    .then(function (res) {
                        console.log(res)
                        app.cyc_list = res.data.data.list.list
                        app.total = res.data.data.list.total
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
                },
                // 显示购物车
                go_shop_car(){
                    window.location.href='../product/shop_car.html'
                },
                car_box(){
                    this.car_active = !this.car_active
                },
                seckilling(){
                    window.location.href='seckilling.html'
                },
                group_buy(){
                    window.location.href='group_buy.html'
                },
                search_btn(){
                    window.location.href='../product/search.html'
                },
                cyc_detail(spuId,periodBuyId){
                    window.location.href='../product/cyc_detail.html?spuId=' + spuId +'&periodBuyId=' + periodBuyId
                }
            }
        })
        
    </script>
</body>

</html>